home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 5
/
Aminet 5 - March 1995.iso
/
Aminet
/
util
/
misc
/
defaultscr_v10.lha
/
DefaultScreen.s
< prev
Wrap
Text File
|
1995-01-08
|
2KB
|
133 lines
;
; DefaultScreen is Copyright © 1994 by Stefano Reksten of 3AM.
; It was made just to learn how to use the ReadArgs() function and the
; LINK/UNLK instructions (these make the program 100 bytes smaller! :-)
;
; This program changes the default public screen and can set the
; SHANGHAI and POPPUBSCREEN flags, if passed the correct arguments.
; I know there are other utilities like (my) PSM to manage public screens,
; but not as small as this one!
;
; To contact me:
;
; rekststef@unisi.it
;
; Stefano Reksten c/o Naimi
; v.le Cavour, 40
; 53100 SIENA - Italy
;
incdir "include:"
include "LVO3.0/exec_lib.i"
include "LVO3.0/dos_lib.i"
include "LVO3.0/intuition_lib.i"
SHANGHAI equ $0001
POPPUBSCREEN equ $0002
DOSBase equ 0
IntuiBase equ 4
ArgsPtr equ 8
Args equ 12
ScrName equ 12
SFLG equ 16
PFLG equ 20
link a5,#-24
move.l 4,a6
lea IntuiName(PC),a1
move.l #37,d0
jsr _LVOOpenLibrary(a6)
beq.w .intuiexit
move.l d0,IntuiBase(SP)
lea DOSName(PC),a1
move.l #37,d0
jsr _LVOOpenLibrary(a6)
beq.w .dosexit
move.l d0,DOSBase(SP)
move.l d0,a6
move.l #Template,d1
move.l SP,d2
add.l #Args,d2
moveq #0,d3
jsr _LVOReadArgs(a6)
beq.b .noscrname
move.l d0,ArgsPtr(SP)
move.l ScrName(SP),d0
tst.l d0
beq.b .noscrname
move.l IntuiBase(SP),a6
move.l d0,a0
jsr _LVOLockPubScreen(a6)
tst d0
beq.b .nopublic
move.l ScrName(SP),a0
jsr _LVOSetDefaultPubScreen(a6)
moveq #0,d0
tst SFLG(SP)
beq.b .noshanghai
or #SHANGHAI,d0
.noshanghai
tst PFLG(SP)
beq.b .nopopup
or #POPPUBSCREEN,d0
.nopopup
jsr _LVOSetPubScreenModes(a6)
move.l #0,a0
move.l d0,a1
jsr _LVOUnlockPubScreen(a6)
bra.b .freeargs
.nopublic
move.l DOSBase(SP),a6
move.l #ErrNoPublic,d1
move.l SP,d2
add.l #Args,d2
jsr _LVOVPrintf(a6)
bra.b .freeargs
.noscrname
move.l #ErrNoName,d1
jsr _LVOVPrintf(a6)
.freeargs
move.l DOSBase(SP),a6
move.l ArgsPtr(SP),d1
jsr _LVOFreeArgs(a6)
move.l 4,a6
move.l DOSBase(SP),a1
jsr _LVOCloseLibrary(a6)
.dosexit
move.l IntuiBase(SP),a1
jsr _LVOCloseLibrary(a6)
.intuiexit
unlk a5
rts
DOSName
dc.b 'dos.library',0
IntuiName
dc.b 'intuition.library',0
even
Template
dc.b 'ScreenName/A,S=Shanghai/S,P=PopScreen/S',0
even
dc.b '$VER: DefaultScreen v1.0 (8.1.95)',$A,0
even
ErrNoName
dc.b 'No public screen name given',$A,0
even
ErrNoPublic
dc.b '%s is not a public screen',$A,0
even